feat: upgrade to OpenShell v0.0.59 and adopt --env flag#59
Merged
Conversation
…nv injection OpenShell v0.0.59 (PR #1730) adds --env KEY=VALUE to sandbox create/exec and fixes a bug where user-specified env vars were silently dropped in SSH sessions. This replaces the file-based env injection workaround. Before: BuildEnvSh() -> write sandbox.env -> upload via --upload -> source in startup command -> cat >> .bashrc for exec sessions. After: BuildEnvMap() -> pass via --env flags on sandbox create -> vars are directly in the container environment. No files, no sourcing. - Add Env map to SandboxCreateOpts, wire --env flags in CLI (sorted) - Add BuildEnvMap() to AgentConfig, refactor BuildEnvSh() to use it - Remove env.sh/sandbox.env generation from RenderPayload() - Remove env.sh sourcing from BuildRunSh() - Simplify startup commands in up/create/launch (no more source/cat) - Add ParseCLIVersion() and CheckMinVersion() version guard - Warn on startup if openshell CLI is below v0.0.59 - Bump chart-version to 0.0.59 - Add 7 new tests covering --env args, version parsing, min-version check
0fb14b1 to
a269e02
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--env KEY=VALUEonsandbox create/execand a fix for env vars being silently dropped in SSH sessionssandbox.envupload +sourcein startup) with native--envflagsBefore
After
No files, no sourcing, no
.bashrcappend. OpenShell handles env var injection natively across all four compute drivers (Docker, Podman, K8s, VM).Test plan
make testpasses (Go unit tests + 29 bats preflight tests)--envarg wiring, version parsing, min-version check,BuildEnvMapmerge/override/emptyharness up --local --show-commands— verify--env KEY=VALUEflags in openshell sandbox create outputopenshell sandbox exec <name> -- env | grep ANTHROPIC_BASE_URL— confirm env var present without file sourcing🤖 Generated with Claude Code